home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue70 / DBEX / Listing7.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-04-30  |  660 b   |  23 lines

  1. var
  2.   Prms: TParams;
  3.   intResult: integer;
  4. begin
  5.   Prms:=TParams.Create;
  6.   try
  7.     Prms.CreateParam(ftString, 'CONTACT_FIRST', ptInput);
  8.     Prms.ParamByName('CONTACT_FIRST').AsString:='Marge';
  9.     Prms.CreateParam(ftString, 'CUSTOMER', ptInput);
  10.     Prms.ParamByName('CUSTOMER').AsString:=
  11.     'Mrs. Beauvais';
  12.     intResult:=SQLConnection1.Execute('UPDATE '+
  13.     'CUSTOMER SET CONTACT_FIRST = :CONTACT_FIRST '+
  14.     'WHERE CUSTOMER = :CUSTOMER', Prms);
  15.     if intResult >= 0 then
  16.       ShowMessage('Success ('+IntToStr(intResult)+')')
  17.     else
  18.       ShowMessage('Failed  ('+IntToStr(intResult)+')');
  19.   finally
  20.     Prms.Free;
  21.   end;
  22. end;
  23.